﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Ink;

namespace PaintApplication
{
    public class AbstractEventHandler
    {

        public AbstractEventHandler( Window1 window)
        {
            _myView = new WindowsView(window);
        }

        private WindowsView _myView;
        private PaintModel _myModel;

        public void InkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e)
        {
            
        }

        public void Rectangle_MouseDown(object sender, MouseButtonEventArgs e)
        {
            IInputElement element = sender as IInputElement;
            // MessageBox.Show(e.Device.ToString());
            Color color = ((SolidColorBrush)((Rectangle)sender).Fill).Color;

            _myView.udpateDrawingPadCanvasColor(color);
            // Set the color on the CurrentColor indicator and on the SurfaceInkCanvas


        }

        public void DrawButton_Click(object sender, RoutedEventArgs e)
        {
            _myView.updateDrawingPadCanvasEditMode("Edit");
        }

        public void EraseButton_Click(object sender, RoutedEventArgs e)
        {
            _myView.updateDrawingPadCanvasEditMode("Erease");
        }

        public void Window_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            //MessageBox.Show(((Window)sender).Width+ " __ "+e.Source.ToString());
        }

        public void TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            //MessageBox.Show(e.OriginalSource.ToString(), e.Source.ToString());
        }

        public void TextBox_KeyDown(object sender, KeyEventArgs e)
        {
            // MessageBox.Show(e.OriginalSource.ToString(), e.Source.ToString());
        }

    }
}
